<!DOCTYPE HTML>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>NativeObj Example</title>
		<script type="text/javascript">
			var bitmap1 = null;
			// H5 plus事件处理
			function plusReady() {
			}
			if(window.plus) {
				plusReady();
			} else {
				document.addEventListener("plusready", plusReady, false);
			}
			var view = null;
			// 创建原生View控件
			function createView() {
				view = new plus.nativeObj.View('test', { top: '0px', left: '0px', height: '44px', width: '100%' });
				// 绘制图片
				view.drawBitmap(bitmap1, { top: '0px', left: '0px', width: '100%', height: '100%' }, { top: 'auto', left: 'auto', width: '100%', height: '100%' });
				view.show();
			}

			function animateView() {
				view.animate({ type: 'shrink', frames: 20, region: { top: '44px', bottom: '48px' } });
			}
		</script>
	</head>

	<body>
		<button onclick="createView()">创建View对象</button><br/>
		<button onclick="animateView()">View对象动画</button><br/>
	</body>

</html>